package com.zzh.structuredeployment.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.zzh.bridge.page.PageApp
import com.zzh.bridge_annotation.RouteTag
import com.zzh.custom.nine.NinePicView
import com.zzh.structuredeployment.R
import com.zzh.tools.utils.ToolLog
import kotlinx.android.synthetic.main.activity_seven.*

@RouteTag(value = PageApp.NINE)
class SevenActivity : AppCompatActivity() {

    private var count: Int = 0

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_seven)
        updateCount.setOnClickListener {
            ninePicView.setData(testList(count % 12))
            showCount.text = count.toString()
            count++
        }
        ninePicView.setOnCirclePicItemLensenter { circlePicView, view, position, circlePicBean ->
            ToolLog.i("zzh", "${position}>>${circlePicBean}")
        }
    }

    private fun testList(count: Int): List<NinePicView.NinePicBean> {
        var list = arrayListOf<NinePicView.NinePicBean>()
        for (i in 0 until count) {
            var bean = NinePicView.NinePicBean()
            bean.url =
                "http://image.gongjiangren.net/portrait/202011/7cf76408efe14e523fe346212e732d59.jpg"
            bean.position = i
            list.add(bean)
        }
        return list
    }


}